export default class gameWinUI_5 extends Laya.Script {
    
    constructor() { super(); }
    private select_btn:Laya.Button
    private rank_btn:Laya.Button
    private next_btn:Laya.Button
    
    onEnable(): void {
       //初始化变量
       this.initParams()
       //初始化绑定事件
       this.initEvent()
    }

    initEvent(){
        //给选择关卡按钮绑定事件
         this.select_btn.on(Laya.Event.CLICK,this,this.onSelectGame)
         //给选择关卡按钮绑定事件
         this.rank_btn.on(Laya.Event.CLICK,this,this.onRank)
         //给选择关卡按钮绑定事件
         this.next_btn.on(Laya.Event.CLICK,this,this.onNextGame)

    }

    onSelectGame(){
        ////跳转到选择关卡场景
        Laya.Scene.open("select_scene.scene")
    }
    onRank(){
        //跳转到排行榜界面场景
        Laya.Scene.open("rank_scene.scene")
    }
    onNextGame(){
        //跳转到第六关
        Laya.Scene.open("gameScene6.scene")
    }

    initParams(){
        //获取开始按钮节点
         this.select_btn=this.owner.getChildByName('select')as Laya.Button
        //获取排行榜按钮节点
        this.rank_btn=this.owner.getChildByName('rank')as Laya.Button
        //获取下一关按钮节点
         this.next_btn=this.owner.getChildByName('next')as Laya.Button
    }

    onDisable(): void {
    }
}